// WeatherResponse.java
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

public class WeatherResponse {
    private String status;
    private String count;
    private String info;
    private String infocode;
    private List<LiveWeather> lives;
    private List<ForecastWeather> forecasts;

    // Getters and setters
    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }

    public String getCount() { return count; }
    public void setCount(String count) { this.count = count; }

    public String getInfo() { return info; }
    public void setInfo(String info) { this.info = info; }

    public String getInfocode() { return infocode; }
    public void setInfocode(String infocode) { this.infocode = infocode; }

    public List<LiveWeather> getLives() { return lives; }
    public void setLives(List<LiveWeather> lives) { this.lives = lives; }

    public List<ForecastWeather> getForecasts() { return forecasts; }
    public void setForecasts(List<ForecastWeather> forecasts) { this.forecasts = forecasts; }

    public static class LiveWeather {
        private String province;
        private String city;
        private String adcode;
        private String weather;
        private String temperature;
        private String winddirection;
        private String windpower;
        private String humidity;
        private String reporttime;
        private String temperature_float;
        private String humidity_float;

        public String getTemperature_float() { return temperature_float; }
        public void setTemperature_float(String temperature_float) { this.temperature_float = temperature_float; }

        public String getHumidity_float() { return humidity_float; }
        public void setHumidity_float(String humidity_float) { this.humidity_float = humidity_float; }

        // Getters and setters
        public String getProvince() { return province; }
        public void setProvince(String province) { this.province = province; }

        public String getCity() { return city; }
        public void setCity(String city) { this.city = city; }

        public String getAdcode() { return adcode; }
        public void setAdcode(String adcode) { this.adcode = adcode; }

        public String getWeather() { return weather; }
        public void setWeather(String weather) { this.weather = weather; }

        public String getTemperature() { return temperature; }
        public void setTemperature(String temperature) { this.temperature = temperature; }

        public String getWinddirection() { return winddirection; }
        public void setWinddirection(String winddirection) { this.winddirection = winddirection; }

        public String getWindpower() { return windpower; }
        public void setWindpower(String windpower) { this.windpower = windpower; }

        public String getHumidity() { return humidity; }
        public void setHumidity(String humidity) { this.humidity = humidity; }

        public String getReporttime() { return reporttime; }
        public void setReporttime(String reporttime) { this.reporttime = reporttime; }

        @Override
        public String toString() {
            return String.format("%s %s %s°C 湿度:%s 风向:%s 风力:%s 更新时间:%s",
                    province, city, temperature, humidity, winddirection, windpower, reporttime);
        }
    }

    public static class ForecastWeather {
        private String city;
        private String adcode;
        private String province;
        private String reporttime;
        private List<Cast> casts;
        private String daytemp_float;
        private String nighttemp_float;

        // Getters and setters
        public String getDaytemp_float() { return daytemp_float; }
        public void setDaytemp_float(String daytemp_float) { this.daytemp_float = daytemp_float; }

        public String getNighttemp_float() { return nighttemp_float; }
        public void setNighttemp_float(String nighttemp_float) { this.nighttemp_float = nighttemp_float; }


        public String getCity() { return city; }
        public void setCity(String city) { this.city = city; }

        public String getAdcode() { return adcode; }
        public void setAdcode(String adcode) { this.adcode = adcode; }

        public String getProvince() { return province; }
        public void setProvince(String province) { this.province = province; }

        public String getReporttime() { return reporttime; }
        public void setReporttime(String reporttime) { this.reporttime = reporttime; }

        public List<Cast> getCasts() { return casts; }
        public void setCasts(List<Cast> casts) { this.casts = casts; }

        public static class Cast {
            private String date;
            private String week;
            @JsonProperty("dayweather")
            private String dayWeather;
            @JsonProperty("nightweather")
            private String nightWeather;
            @JsonProperty("daytemp")
            private String dayTemp;
            @JsonProperty("nighttemp")
            private String nightTemp;
            @JsonProperty("daywind")
            private String dayWind;
            @JsonProperty("nightwind")
            private String nightWind;
            @JsonProperty("daypower")
            private String dayPower;
            @JsonProperty("nightpower")
            private String nightPower;
            private String daytemp_float;
            private String nighttemp_float;
            // 新增 getter 和 setter 方法
            public String getDaytemp_float() { return daytemp_float; }
            public void setDaytemp_float(String daytemp_float) { this.daytemp_float = daytemp_float; }

            public String getNighttemp_float() { return nighttemp_float; }
            public void setNighttemp_float(String nighttemp_float) { this.nighttemp_float = nighttemp_float; }

            // Getters and setters
            public String getDate() { return date; }
            public void setDate(String date) { this.date = date; }

            public String getWeek() { return week; }
            public void setWeek(String week) { this.week = week; }

            public String getDayWeather() { return dayWeather; }
            public void setDayWeather(String dayWeather) { this.dayWeather = dayWeather; }

            public String getNightWeather() { return nightWeather; }
            public void setNightWeather(String nightWeather) { this.nightWeather = nightWeather; }

            public String getDayTemp() { return dayTemp; }
            public void setDayTemp(String dayTemp) { this.dayTemp = dayTemp; }

            public String getNightTemp() { return nightTemp; }
            public void setNightTemp(String nightTemp) { this.nightTemp = nightTemp; }

            public String getDayWind() { return dayWind; }
            public void setDayWind(String dayWind) { this.dayWind = dayWind; }

            public String getNightWind() { return nightWind; }
            public void setNightWind(String nightWind) { this.nightWind = nightWind; }

            public String getDayPower() { return dayPower; }
            public void setDayPower(String dayPower) { this.dayPower = dayPower; }

            public String getNightPower() { return nightPower; }
            public void setNightPower(String nightPower) { this.nightPower = nightPower; }

            @Override
            public String toString() {
                return String.format("%s (%s) 白天:%s(%s°C) 夜间:%s(%s°C)",
                        date, week, dayWeather, dayTemp, nightWeather, nightTemp);
            }
        }
    }
}
